<template>
  <div class="wh-100 ">
    <div class="h-10  or-base-b py-32 pl-24 fw-6 fs-18">
      信息通知
    </div>
    <div class="h-80">
      <div v-for="(item, index) in data" :key="index" class="bor-base-b px-16 d-flex-between-center">
        <div>
          <div style="font-size: 14px;font-weight: bold" class="pt-8">{{ item.messageTitle }}</div>
          <div style="font-size: 12px" class="pt-8 pb-8">{{ item.messageContent }}</div>
        </div>

        <div>
          <el-button type="text">查看</el-button>
        </div>
      </div>
    </div>
    <div class="h-10 w-100  fs-16 d-flex-align-center">
      <Page  show-sizer
             :total="pageTotal"
             :current="pageCurrent"
             :page-size="pageParams.pageSize"
             @on-change="changePage"
             @on-page-size-change="changePageSize"
             show-elevator />
    </div>
  </div>

<!--  <div class="wh-100 " style="height: var(&#45;&#45;layout-height)" v-loading="loading">-->
<!--    &lt;!&ndash;头部&ndash;&gt;-->
<!--    <div class="h-10 bor-base-b py-32 pl-24 fw-6 fs-18">-->
<!--      信息通知-->
<!--    </div>-->
<!--    <div  class="h-80 w-100  px-24  overflow-auto" style="height: calc(100% - 130px )">-->

<!--    </div>-->
<!--    <div class="h-10 w-100  fs-16 mt-12 d-flex-align-center ">-->
<!--      <Page  show-sizer-->
<!--             :total="pageTotal"-->
<!--             :current="pageCurrent"-->
<!--             :page-size="pageParams.pageSize"-->
<!--             @on-change="changePage"-->
<!--             @on-page-size-change="changePageSize"-->
<!--             show-elevator />-->
<!--    </div>-->
<!--  </div>-->
</template>

<script>
import HeadComponents from "../../mutualSelection/systemManagement/my-components/headComponents.vue";

export default {
  components: {HeadComponents},
  data(){
    return{
      loading:false,
      title:'消息通知',
      tip:'仅保留近3个月收到的通知',
      data: [],
      pageCurrent:0,
      pageTotal:0,
      pageParams:{
        pageSize: 10,
        pageNumber: 1,
        messageType:"0"
      },
      optionsList: [
        {
          value: "0",
          label: '全部'
        },
        {
          value: "1",
          label: '系统通知'
        },
        {
          value: "2",
          label: '简历投递'
        },
        {
          value: "3",
          label: '审核信息'
        },
      ],
    }
  },
  mounted() {
    //dom以后，获取默认数据
    this.postData();
  },
  watch:{
  },
  methods:{
    postData:function (){
      this.loading=true
      this.postRequest('/messageLog/pageByType',this.pageParams).then(res=>{
        console.log(res)
        this.data=res?.result?.records || [];
        this.pageCurrent=res?.result?.current || 1;
        this.pageTotal=res?.result?.total || 0;
        this.loading=false
      });
    },
    changePage:function (val){
      this.pageCurrent=val;
      this.pageParams.pageNumber=val;
      this.postData();
    },
    changePageSize:function (val){
      this.pageParams.pageSize=val;
      this.postData();
    }
  }
}
</script>
